package com.itheima.web;

import com.itheima.service.RoleUserService;
import com.itheima.support.Result;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/roleuser")
public class RoleUserController {

    @DubboReference
    private RoleUserService roleUserService;

    @GetMapping("findRoleIdByUserId/{userId}")
    public Result<Long[]> findRoleIdByUserId(@PathVariable("userId") Long userId) {
        return Result.build(roleUserService.findRoleIdByUserId(userId));
    }

}
